//
// Created by hugan on 2020/11/16.
//

#ifndef HUP_UTILS_PARENT_CPP_BATTERYINFOUTIL_H
#define HUP_UTILS_PARENT_CPP_BATTERYINFOUTIL_H

#include <Windows.h>

/**
 * 电源信息工具类
 * GetSystemPowerStatus
 * https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getsystempowerstatus
 * SYSTEM_POWER_STATUS
 * https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-system_power_status
 * 实例
 * https://blog.csdn.net/weixin_45145710/article/details/105516553
 */
class BatteryUtil {
public:
    /**
     * 查询是否连接充电器
     * @return 0-否,1-是,255-未知
     */
    static int isAcOnline();

    /**
     * 获取电量值
     * @return [0~100]-正常值,255-未知
     */
    static int getBatteryValue();
};

#endif //HUP_UTILS_PARENT_CPP_BATTERYINFOUTIL_H
